[POWERPC][XEN] Use top-level CFLAGS.
authorHollis Blanchard <hollisb@us.ibm.com>
Mon, 16 Jul 2007 19:20:16 +0000 (14:20 -0500)
committerHollis Blanchard <hollisb@us.ibm.com>
Mon, 16 Jul 2007 19:20:16 +0000 (14:20 -0500)
- Append to CFLAGS instead of replacing it.
- Fix newly-exposed mixed statement/declaration warnings.

xen/arch/powerpc/Rules.mk
xen/arch/powerpc/mpic_init.c
xen/arch/powerpc/of-devtree.c
xen/arch/powerpc/of-devwalk.c
xen/arch/powerpc/of_handler/ofh.c
xen/arch/powerpc/ofd_fixup.c
xen/include/asm-powerpc/xenoprof.h

index fd26632ae6c96f9fda9e27184f42580e95a38e7a..49e0e5477ab5029512b2a12ca7ce2630d7c408a9 100644 (file)
@@ -9,8 +9,8 @@ C_WARNINGS := -Wredundant-decls
 # _no_ common code can have packed data structures or we are in touble.
 C_WARNINGS += -Wpacked
 
-CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common
-CFLAGS += -iwithprefix include -Wall -Werror -pipe
+CFLAGS += -m64 -ffreestanding -fno-builtin -fno-common
+CFLAGS += -iwithprefix include -Werror -pipe
 CFLAGS += -I$(BASEDIR)/include
 CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic
 CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-default
index 22952f54fe8a94a98018493c5b2f687b3c5dd219..f4e4074ae1f44682237944a4c068387e54d0663d 100644 (file)
@@ -153,13 +153,15 @@ static unsigned long find_ranges_addr_from_node(void *oft_p, ofdn_t c)
     u32 addr_c = 2;
     u32 ranges[64];
     int p_len;
+    int i;
 
     parent = ofd_node_parent(oft_p, c);
     parent = ofd_node_parent(oft_p, parent);
 
     p_len = ofd_getprop(oft_p, parent, "ranges", &ranges, sizeof(ranges));
     DBG("%s: ranges\n", __func__);
-    int i; for (i=0; i<p_len; i++) {DBG("%08x ", ranges[i]);}
+    for (i=0; i<p_len; i++)
+        DBG("%08x ", ranges[i]);
     DBG("\n");
 
     p_len = ofd_getprop(oft_p, parent, "#address-cells",
index c437ef4569f4878469d02407d9524426ef75be8b..ff5efdff16ec33604b1e122abf54ae4fd5367830 100644 (file)
@@ -939,12 +939,12 @@ ofdn_t ofd_node_find_by_prop(
     size_t sz)
 {
     struct ofd_mem *m = (struct ofd_mem *)mem;
+    ofdn_t prev = -1;
 
     if ( n <= 0 ) {
         n = OFD_ROOT;
     }
 
-    ofdn_t prev = -1;
     return ofd_find_by_prop(m, -1, &prev, n, name, val, sz);
 }
 
index 3f63697f130803a6db3c753c7908c6153a2f1c40..697ebb190162898b87a032b931400d91e5e7c796 100644 (file)
@@ -32,13 +32,13 @@ void ofd_prop_print(
     const char *prop,
     size_t sz)
 {
+#define DEBUG_PROP
+#ifndef DEBUG_PROP
     if ( path[0] == '/' && path[1] == '\0' ) {
         path = "";
     }
     printk("%s: %s/%s: 0x%lx\n", head, path,  name, sz);
-
-#define DEBUG_PROP
-#ifdef DEBUG_PROP
+#else
     int i;
     int isstr = sz;
     const char *b = prop;
@@ -75,8 +75,6 @@ void ofd_prop_print(
         }
         printk("\n");
     }
-#else
-    (void)prop;
 #endif
 }
 
index 84ea27fb4faef00f6376a28d8290047278b60da2..06d700eaa9022c0bf0eb6c7ac998255f6e90f276 100644 (file)
@@ -50,30 +50,14 @@ s32 debug(const char *fmt, ...)
 void
 assprint(const char *expr, const char *file, int line, const char *fmt, ...)
 {
-    char a[15];
-
-    a[0]  = '\n';
-    a[1]  = '\n';
-    a[2]  = 'O';
-    a[3]  = 'F';
-    a[4]  = 'H';
-    a[5]  = ':';
-    a[6]  = 'A';
-    a[7]  = 'S';
-    a[8]  = 'S';
-    a[9]  = 'E';
-    a[10] = 'R';
-    a[11] = 'T';
-    a[12] = '!';
-    a[13] = '\n';
-    a[14] = '\n';
-
+    char a[15] = {
+       '\n', '\n', 'O', 'F', 'H', ':', 'A', 'S', 'S', 'E', 'R', 'T', '!',
+       '\n', '\n',
+    };
     s32 actual;
     u32 t = 1;
     volatile u32 *tp = &t;
 
-    (void)expr; (void)file; (void)line; (void)fmt;
-
     ofh_cons_write(a, sizeof (a), &actual);
 
     /* maybe I can break out of this loop manually (like with a
index 6deb3c888c46e65fdc30d21a2659ed8635381eb9..b2432aade9e991414978b55825837823ec81f7cd 100644 (file)
@@ -363,9 +363,12 @@ static ofdn_t ofd_xen_props(void *m, struct domain *d, ulong shared_info)
 ulong ofd_dom0_fixup(struct domain *d, ulong mem, const char *cmdline,
                      ulong shared_info)
 {
+    const char compat[] = "Hypervisor,Maple";
+    const char d0[] = "dom0";
     void *m;
     const ofdn_t n = OFD_ROOT;
     ofdn_t r;
+    u32 did;
 
     m = (void *)mem;
 
@@ -404,16 +407,16 @@ ulong ofd_dom0_fixup(struct domain *d, ulong mem, const char *cmdline,
     rtas_proxy_init(m);
 
 #ifdef FIX_COMPAT 
-    const char compat[] = "Hypervisor,Maple";
     r = ofd_prop_add(m, n, "compatible", compat, sizeof (compat));
     ASSERT( r > 0 );
+#else
+    (void)compat;
 #endif
 
-    u32 did = d->domain_id;
+    did = d->domain_id;
     r = ofd_prop_add(m, n, "ibm,partition-no", &did, sizeof(did));
     ASSERT( r > 0 );
 
-    const char d0[] = "dom0";
     r = ofd_prop_add(m, n, "ibm,partition-name", d0, sizeof (d0));
     ASSERT( r > 0 );
 
index 3d17cc519323e9021fa8cd7e74ae12fd5ef3dbbb..195796e5d15f1fc2a155c981cab7413515bcbcb2 100644 (file)
@@ -83,7 +83,7 @@ static inline void ctr_write(unsigned int i, unsigned int val)
     }
 }
 
-static inline void print_perf_status()
+static inline void print_perf_status(void)
 {
     ulong mmcr0 = mfmmcr0();
     ulong mmcr1 = mfmmcr1();